import request from '@/utils/request'

// 获取区域列表
export const blockSearchList = (params) => {
  return request({
    url: '/api/vm-service/region/search',
    method: 'GET',
    params
  })
}

// 获取区域详情

export const blockInfo = (params) => {
  return request({
    url: `/api/vm-service/region/${params.id}`,
    method: 'GET',
    params
  })
}

// 点位搜索

export const nodeSearch = (params) => {
  return request({
    url: '/api/vm-service/node/search',
    method: 'GET',
    params
  })
}

// 合作商搜索

export const partnerSearch = (params) => {
  return request({
    url: '/api/user-service/partner/search',
    method: 'GET',
    params
  })
}

// 新增点位

export const addNodeApi = (data) => {
  return request({
    url: '/api/vm-service/node',
    method: 'POST',
    data
  })
}

// 商圈列表
export const businessType = () => {
  return request({
    url: '/api/vm-service/businessType',
    method: 'GET'
  })
}

// 新增区域

export const addBlockApi = (data) => {
  return request({
    url: '/api/vm-service/region',
    method: 'POST',
    data
  })
}

// 修改区域
export const changeBlockApi = (data) => {
  return request({
    url: `/api/vm-service/region/${data.id}`,
    method: 'PUT',
    data
  })
}

// 点位详情

export const pontInfoApi = (id) => {
  return request({
    url: `/api/vm-service/node/vmList/${id}`
  })
}
